C++_C++基于对话框的程序的框架实例,本文实例讲述了C++基于对话框
}
resource.h头文件如下:
{{
{
ON_BN_CLICKED(IDC_STOP, OnStop)
}
END_MESSAGE_MAP()
return 0;
return FALSE; //不进入消息循环
CMainDialog dlg;
BEGIN_MESSAGE_MAP(CMainDialog, CDialog)
CMyApp theApp;
{
return TRUE;
//CMainDialog
}
public:
#define WM_CUTTERSTART WM_USER+100
DECLARE_MESSAGE_MAP()
};
复制代码 代码如下:
ON_MESSAGE(WM_CUTTERSTART, OnCutterStart) //自定义消息class CMyApp:public CWinApp
CMainDialog::CMainDialog(CWnd* pParentWnd):CDialog(IDD_MAIN, pParentWnd)
MessageBox("OnCutterStart");
#include <afxwin.h>
long CMainDialog::OnCutterStart(WPARAM wParam, LPARAM lParam) //处理自定义消息
}
m_pMainWnd = &dlg; //给m_pMainWnd 主窗口
}
virtual BOOL OnInitDialog( );
void CMainDialog::OnStop()
CDialog::OnInitDialog();
}; afx_msg long OnCutterStart(WPARAM wParam, LPARAM lParam); //处理自定义消息的声明
BOOL CMainDialog::OnInitDialog( )
复制代码 代码如下:
//CMyDialogclass CMainDialog:public CDialog
{
//CMyApp
resource.cpp源文件如下:
{
BOOL CMyApp::InitInstance()
CMainDialog(CWnd* pParentWnd = NULL);
public:
protected:
MessageBox("OnStop");
{
#include "resource.h"
afx_msg void OnStop();
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/jiaob/cjj/6467.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
只需要在调用Ctrl+B编译后
时间:2021-01-13
-
OpenGL超级宝典visual studio
时间:2021-01-04
-
Directx11 教程(2) 基本的wi
时间:2021-01-04
-
LeetCode11ContainerWithMostWate
时间:2021-01-04
-
C语言简单IT之家速成
时间:2020-12-27
-
三分钟了解Activity工作流
时间:2020-12-27
-
编译器是如何实现32位整型
时间:2020-12-27
-
C++中lower_bound函数和upper
时间:2020-12-27
热门文章
-
LeetCode11ContainerWithMostWater(最大水容器)
时间:2021-01-04
-
C语言简单编程速成
时间:2020-12-23
-
都2020了,这五个最佳C++的IDE你还没用过?
时间:2020-12-23
-
C语言源程序文件的后缀是什么?
时间:2020-12-23
-
OpenGL超级宝典visual studio 2013开发环境配置
时间:2021-01-04
-
编译器是如何实现32位整型的常量整数除
时间:2020-12-27
-
libusbwin32学习笔记(二)
时间:2020-12-27
-
C语言简单IT之家速成
时间:2020-12-27
-
C语言和Python语言有什么区别呢?
时间:2020-12-24
-
C++对象模型之RTTI的实现原理
时间:2020-12-23
